package org.vidad.algo.bendit;

import java.util.Random;

public abstract class Gambler {
	protected static Random random = new Random();

	private int leverCount = -1;

	public int getLeverCount() {
		return leverCount;
	}

	public double getScore() {
		return score;
	}

	private double score = 0d;

	// / <summary>Sum of the observed values.</summary>

	// / <summary>
	// / Gets the number of levers (of arms) of the multi-armed bandit.
	// / </summary>
	// public int LeverCount;

	// / <summary>Empty constructor.</summary>
	protected Gambler() {
	}

	// / <summary>Resets the <see cref="Gambler"/>.</summary>
	// / <remarks>When n, the base method MUST be called.</remarks>
	public void Reset() {
		score = 0d;
	}

	// / <param name="horizon">Number of turns to be played
	// / after the current one.</param>
	public abstract int Play(int horizon);

	// / <param name="index">Variable index.</param>
	// / <param name="value">Value generated by the variable.</param>
	// / <remarks>When n, the base method MUST be called.</remarks>
	public void Observe(int index, double value) {
		score += value;
	}
}
